home *** CD-ROM | disk | FTP | other *** search
- on showPage direction
- global textSprite
- set nextPageCastNumber to getNextPageCast(direction)
- set the castNum of sprite textSprite to nextPageCastNumber
- setTopicTextAttributes(nextPageCastNumber)
- updateCurrentPage(direction)
- showMoreButtons()
- updateStage()
- end
-
- on resetCurrentPage
- global currentPage
- set currentPage to 1
- end
-
- on updateCurrentPage direction
- global currentPage
- set currentPage to currentPage + direction
- end
-
- on setCurrentPage
- global currentPage, textSprite
- set currentPage to value(the last char in the name of cast the castNum of sprite textSprite)
- end
-
- on getNextPageCast direction
- global textSprite, currentPage
- set currentCastName to the name of cast the castNum of sprite textSprite
- set numCharsInName to the number of chars in currentCastName
- set nextPageCastName to char 1 to numCharsInName - 1 of currentCastName & string(currentPage + direction)
- return the number of cast nextPageCastName
- end
-
- on showMoreButtons
- global pageUpButton, pageDownButton
- if morePagesExist(-1) then
- set upStatus to 1
- else
- set upStatus to 0
- end if
- if morePagesExist(1) then
- set downStatus to 1
- else
- set downStatus to 0
- end if
- if upStatus and downStatus then
- showPageUpButton("Enabled")
- showPageDownButton("Enabled")
- end if
- if upStatus and not downStatus then
- showPageUpButton("Enabled")
- showPageDownButton("Disabled")
- end if
- if not upStatus and downStatus then
- showPageDownButton("Enabled")
- showPageUpButton("Disabled")
- end if
- if not upStatus and not downStatus then
- removeMoreButtons()
- end if
- end
-
- on removeMoreButtons
- global pageUpButton, pageDownButton
- removeFromStage(pageUpButton)
- removeFromStage(pageDownButton)
- end
-
- on morePagesExist direction
- set nextPageCastNumber to getNextPageCast(direction)
- if nextPageCastNumber <> -1 then
- return 1
- else
- return 0
- end if
- end
-
- on showPageUpButton status
- global pageUpButton, pageUpH, pageUpV
- changeButtonCast(pageUpButton, status)
- set the locH of sprite pageUpButton to pageUpH
- set the locV of sprite pageUpButton to pageUpV
- end
-
- on showPageDownButton status
- global pageDownButton, pageDownH, pageDownV
- changeButtonCast(pageDownButton, status)
- set the locH of sprite pageDownButton to pageDownH
- set the locV of sprite pageDownButton to pageDownV
- end
-